<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>编辑小说类别</title>
    <link rel="stylesheet" type="text/css" href="/tourismsystem/css/query.css" />
    <script type="text/javascript" src="/tourismsystem/js/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="/tourismsystem/js/category.js"></script>
    <script type="text/javascript">
        $(function (){
            var params = new URLSearchParams(window.location.search);
            var newid = params.get("newid");
            if (newid !=null && newid != ""){
                var url = "/tourismsystem/selectById.new";
                var jsonPram = {
                    "newid" : newid
                };
                $.post(url,jsonPram,function (data){
                    var jsonObj = JSON.parse(data);
                    if (jsonObj.category === "公告")
                        $("#gonggao").prop("checked",true);
                    else
                        $("#dongtai").prop("checked",true);

                    $("#title").val(jsonObj.title);
                    $("#content").val(jsonObj.content);
                })

            }
        })
    </script>
</head>
<body>
<div id="top">·当前位置： 资讯管理 -- 添加资讯</div>
<form action="/tourismsystem/saveOne.new">
    <table id="tab" style="margin-top: 30px; border-collapse:separate; border-spacing:0px 10px;">
        <tr>
            <td align="right">类别 : </td>
            <td align="left">&nbsp;<input type="radio" name="category" id="gonggao" value="公告" checked="checked">公告<input type="radio" id="dongtai" name="category" value="动态">动态</td>
        </tr>
        <tr>
            <td align="right" style="width:40%;">标题 : </td>
            <td align="left">&nbsp;<input type="text" name="title" id="title" /><span
                    style="color: red"> *</span><span id="message0" style="color: red;" class="message"></span></td>
        </tr>
        <tr>
            <td align="right">内容 : </td>
            <td align="left">&nbsp;<textarea name="content" id="content"></textarea><span
                    style="color: red"> *</span><span id="message1" style="color: red;" class="message"></span></td>
        </tr>
        <tr>
            <td colspan="2"><input style="width: 60px;" type="submit" id="submit"
                                   value="提交" /></td>
        </tr>
    </table>
</form>
</body>
</html>